/*
 * Copyright (c) 2023 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef APP_FILE_SERVICE_FILE_URI_H
#define APP_FILE_SERVICE_FILE_URI_H

#include "common_const.h"
#include "uri.h"

namespace OHOS {
namespace AppFileService {
namespace ModuleFileUri {
using namespace std;

class FileUri : public OHOS::Uri {
public:
    explicit FileUri(const string &uri): Uri(uri) {}
    static bool IsMediaUri(const string &uri);
    static bool IsMediaFileUri(const string &uri);
    static bool IsFileUri(const string &uri);
    static int32_t TransToDataShareUri(const string &uri, string &dataShareUri);
    static int32_t TransToFileUri(const string &uri, string &fileUri);
    static int32_t GetIdFromUri(const string &uri, string &id);
    static int32_t GetNetWorkIdFromUri(const string &uri, string &networkId);
    static int32_t Open(const string &uri, uint32_t mode);
    ~FileUri() = default;
};
} // namespace ModuleFileUri
} // namespace AppFileService
} // namespace OHOS

#endif